home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / libcruft / ranlib / ranlib.chs < prev    next >
Text File  |  1996-07-19  |  12KB  |  337 lines

  1.                     SUMMARY OF ROUTINES IN RANLIB
  2.  
  3. 0. Base Level Routines to Set and Obtain Values of Seeds
  4.  
  5. (These should be the only base level routines used by  those who don't
  6. need multiple generators with blocks of numbers.)
  7.  
  8. C**********************************************************************
  9. C
  10. C      SUBROUTINE SETALL(ISEED1,ISEED2)
  11. C               SET ALL random number generators
  12. C      INTEGER ISEED1, ISEED2
  13. C
  14. C**********************************************************************
  15. C**********************************************************************
  16. C
  17. C     SUBROUTINE GETSD(ISEED1,ISEED2)
  18. C               GET SeeD
  19. C     INTEGER ISEED1, ISEED2
  20. C
  21. C     Returns the value of two integer seeds of the current generator
  22. C     in ISEED1, ISEED2
  23. C
  24. C**********************************************************************
  25.  
  26. I. Higher Level Routines
  27.  
  28. C**********************************************************************
  29. C
  30. C     REAL FUNCTION GENBET( A, B )
  31. C               GeNerate BETa random deviate
  32. C     REAL A,B
  33. C
  34. C     Returns a single random deviate from the beta distribution with
  35. C     parameters A and B.  The density of the beta is
  36. C               x^(a-1) * (1-x)^(b-1) / B(a,b) for 0 < x < 1
  37. C
  38. C**********************************************************************
  39. C**********************************************************************
  40. C
  41. C     REAL FUNCTION GENCHI( DF )
  42. C                Generate random value of CHIsquare variable
  43. C     REAL DF
  44. C
  45. C     Generates random deviate from the distribution of a chisquare
  46. C     with DF degrees of freedom random variable.
  47. C
  48. C**********************************************************************
  49. C**********************************************************************
  50. C
  51. C     REAL FUNCTION GENEXP( AV )
  52. C                    GENerate EXPonential random deviate
  53. C     REAL AV
  54. C
  55. C     Generates a single random deviate from an exponential
  56. C     distribution with mean AV.
  57. C
  58. C**********************************************************************
  59. C**********************************************************************
  60. C
  61. C     REAL FUNCTION GENF( DFN, DFD )
  62. C                GENerate random deviate from the F distribution
  63. C     REAL DFN, DFD
  64. C
  65. C     Generates a random deviate from the F (variance ratio)
  66. C     distribution with DFN degrees of freedom in the numerator
  67. C     and DFD degrees of freedom in the denominator.
  68. C
  69. C**********************************************************************
  70. C**********************************************************************
  71. C
  72. C     REAL FUNCTION GENGAM( A, R )
  73. C           GENerates random deviates from GAMma distribution
  74. C     REAL A, R
  75. C
  76. C     Generates random deviates from the gamma distribution whose
  77. C     density is
  78. C          (A**R)/Gamma(R) * X**(R-1) * Exp(-A*X)
  79. C
  80. C**********************************************************************
  81. C**********************************************************************
  82. C
  83. C     SUBROUTINE GENMN(PARM,X,WORK)
  84. C              GENerate Multivariate Normal random deviate
  85. C     REAL PARM(*), X(*), WORK(*)
  86. C
  87. C     PARM is set by SETGMN which must be called prior to GENMN.  The
  88. C     generated deviates are placed in X.  WORK is a work array of the
  89. C     same size as X.
  90. C
  91. C**********************************************************************
  92. C**********************************************************************
  93. C
  94. C     REAL FUNCTION GENNCH( DF, XNONC )
  95. C           Generate random value of Noncentral CHIsquare variable
  96. C     REAL DF, XNONC
  97. C
  98. C     Generates random deviate  from the  distribution  of a  noncentral
  99. C     chisquare with DF degrees  of freedom and noncentrality  parameter
  100. C     XNONC.
  101. C
  102. C**********************************************************************
  103. C**********************************************************************
  104. C
  105. C     REAL FUNCTION GENNF( DFN, DFD, XNONC )
  106. C           GENerate random deviate from the Noncentral F distribution
  107. C     REAL DFN, DFD, XNONC
  108. C
  109. C     Generates a random deviate from the  noncentral F (variance ratio)
  110. C     distribution with DFN degrees of freedom in the numerator, and DFD
  111. C     degrees of freedom in the denominator, and noncentrality parameter
  112. C     XNONC.
  113. C
  114. C**********************************************************************
  115. C**********************************************************************
  116. C
  117. C     REAL FUNCTION GENNOR( AV, SD )
  118. C         GENerate random deviate from a NORmal distribution
  119. C     REAL AV, SD
  120. C
  121. C     Generates a single random deviate from a normal distribution
  122. C     with mean, AV, and standard deviation, SD.
  123. C
  124. C**********************************************************************
  125. C**********************************************************************
  126. C
  127. C    SUBROUTINE GENPRM( IARRAY, LARRAY )
  128. C               GENerate random PeRMutation of iarray
  129. C    INTEGER IARRAY(LARRAY), LARRAY
  130. C
  131. C**********************************************************************
  132. C**********************************************************************
  133. C
  134. C     REAL FUNCTION GENUNF( LOW, HIGH )
  135. C               GeNerate Uniform Real between LOW and HIGH
  136. C     REAL LOW, HIGH
  137. C
  138. C**********************************************************************
  139. C**********************************************************************
  140. C
  141. C     INTEGER FUNCTION IGNBIN( N, P )
  142. C                    GENerate BINomial random deviate
  143. C     INTEGER N
  144. C     REAL P
  145. C
  146. C     Returns a single random deviate from a binomial
  147. C     distribution whose number of trials is N and whose
  148. C     probability of an event in each trial is P.
  149. C
  150. C**********************************************************************
  151. C**********************************************************************
  152. C
  153. C     INTEGER FUNCTION IGNPOI( AV )
  154. C                    GENerate POIsson random deviate
  155. C     REAL AV
  156. C
  157. C     Generates a single random deviate from a Poisson
  158. C     distribution with mean AV.
  159. C
  160. C**********************************************************************
  161. C**********************************************************************
  162. C
  163. C     INTEGER FUNCTION IGNUIN( LOW, HIGH )
  164. C               GeNerate Uniform INteger
  165. C     INTEGER LOW, HIGH
  166. C
  167. C     Generates an integer uniformly distributed between LOW and HIGH.
  168. C
  169. C**********************************************************************
  170. C**********************************************************************
  171. C
  172. C     SUBROUTINE PHRTSD( PHRASE, SEED1, SEED2 )
  173. C               PHRase To SeeDs
  174. C     CHARACTER*(*) PHRASE
  175. C     INTEGER SEED1, SEED2
  176. C
  177. C     Uses a phrase (character string) to generate two seeds for the RGN
  178. C     random number generator.
  179. C
  180. C**********************************************************************
  181. C**********************************************************************
  182. C
  183. C     REAL FUNCTION RANF()
  184. C                RANDom number generator as a Function
  185. C
  186. C     Returns a random floating point number from a uniform distribution
  187. C     over 0 - 1 (endpoints of this interval are not returned) using the
  188. C     current generator
  189. C
  190. C**********************************************************************
  191. C**********************************************************************
  192. C
  193. C     SUBROUTINE SETGMN( MEANV, COVM, P, PARM)
  194. C            SET Generate Multivariate Normal random deviate
  195. C     INTEGER P
  196. C     REAL MEANV(P), COVM(P,P), PARM(P*(P+3)/2 + 1)
  197. C
  198. C     P is the length of normal vectors to be generated, MEANV
  199. C     is the vector of their means and COVM is their variance
  200. C     covariance matrix.  Places information necessary to generate
  201. C     the deviates in PARM.
  202. C
  203. C**********************************************************************
  204.  
  205. II. Uniform Generator and Associated Routines
  206.  
  207.  
  208.       A. SETTING THE SEED OF ALL GENERATORS
  209.  
  210. C**********************************************************************
  211. C
  212. C      SUBROUTINE SETALL(ISEED1,ISEED2)
  213. C               SET ALL random number generators
  214. C      INTEGER ISEED1, ISEED2
  215. C
  216. C**********************************************************************
  217.  
  218.       B. OBTAINING RANDOM NUMBERS
  219.  
  220. C**********************************************************************
  221. C
  222. C     INTEGER FUNCTION IGNLGI()
  223. C               GeNerate LarGe Integer
  224. C
  225. C     Returns a random integer following a uniform distribution over
  226. C     (1, 2147483562) using the current generator.
  227. C
  228. C**********************************************************************
  229.  
  230. C**********************************************************************
  231. C
  232. C     REAL FUNCTION RANF()
  233. C                RANDom number generator as a Function
  234. C
  235. C     Returns a random floating point number from a uniform distribution
  236. C     over 0 - 1 (endpoints of this interval are not returned) using the
  237. C     current generator
  238. C
  239. C**********************************************************************
  240.  
  241.       C. SETTING AND OBTAINING THE NUMBER OF THE CURRENT GENERATOR
  242.  
  243. C**********************************************************************
  244. C
  245. C     SUBROUTINE SETCGN( G )
  246. C                      Set GeNerator
  247. C     INTEGER G
  248. C
  249. C     Sets  the  current  generator to G. All references to a generator
  250. C     are to the current generator.
  251. C
  252. C**********************************************************************
  253.  
  254. C**********************************************************************
  255. C
  256. C      SUBROUTINE GETCGN(G)
  257. C               GET Current GeNerator
  258. C      INTEGER G
  259. C
  260. C      Returns in G the number of the current random number generator
  261. C
  262. C**********************************************************************
  263.  
  264.       D. OBTAINING OR CHANGING SEEDS IN CURRENT GENERATOR
  265.  
  266. C**********************************************************************
  267. C
  268. C     SUBROUTINE ADVNST(K)
  269. C               ADV-a-N-ce ST-ate
  270. C     INTEGER K
  271. C
  272. C     Advances the state  of  the current  generator  by 2^K values  and
  273. C     resets the initial seed to that value.
  274. C
  275. C**********************************************************************
  276.  
  277. C**********************************************************************
  278. C
  279. C     SUBROUTINE GETSD(ISEED1,ISEED2)
  280. C               GET SeeD
  281. C     INTEGER ISEED1, ISEED2
  282. C
  283. C     Returns the value of two integer seeds of the current generator
  284. C     in ISEED1, ISEED2
  285. C
  286. C**********************************************************************
  287.  
  288. C**********************************************************************
  289. C
  290. C     SUBROUTINE INITGN(ISDTYP)
  291. C          INIT-ialize current G-e-N-erator
  292. C
  293. C     INTEGER ISDTYP    The state to which the generator is to be set
  294. C          ISDTYP = -1  => sets the seeds to their initial value
  295. C          ISDTYP =  0  => sets the seeds to the first value of
  296. C                          the current block
  297. C          ISDTYP =  1  => sets the seeds to the first value of
  298. C                          the next block
  299. C
  300. C**********************************************************************
  301.  
  302. C**********************************************************************
  303. C
  304. C     SUBROUTINE SETSD(ISEED1,ISEED2)
  305. C               SET S-ee-D of current generator
  306. C
  307. C     Resets the initial  seed of  the current  generator to  ISEED1 and
  308. C     ISEED2. The seeds of the other generators remain unchanged.
  309. C
  310. C**********************************************************************
  311.  
  312.       E. MISCELLANY
  313.  
  314. C**********************************************************************
  315. C
  316. C     INTEGER FUNCTION MLTMOD(A,S,M)
  317. C                    Returns (A*S) MOD M
  318. C     INTEGER A, S, M
  319. C
  320. C**********************************************************************
  321.  
  322. C**********************************************************************
  323. C
  324. C      SUBROUTINE SETANT(QVALUE)
  325. C               SET ANTithetic
  326. C      LOGICAL QVALUE
  327. C
  328. C     Sets whether the current generator produces antithetic values.  If
  329. C     X   is  the value  normally returned  from  a uniform [0,1] random
  330. C     number generator then 1  - X is the antithetic  value. If X is the
  331. C     value  normally  returned  from a   uniform  [0,N]  random  number
  332. C     generator then N - 1 - X is the antithetic value.
  333. C
  334. C     All generators are initialized to NOT generate antithetic values.
  335. C
  336. C**********************************************************************
  337.